package com.myCinema.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
		private static SessionFactory factory;
		static{
			Configuration cfg = new Configuration();
			cfg.configure();
			factory = cfg.buildSessionFactory();
		}
		
		public static Session openSession(){
			return factory.openSession();
		}
		
		public static void main(String[] args) {
			Session sess = HibernateUtil.openSession();
			
		}
}
